#include<iostream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int a = 0;
	int b = 0;
	if (n % 2 == 0) {
		a = 1;
	}
	if (n > 4 && n <= 12) {
		b = 1;
	}
	int flag1 = a & b;
	int flag2 = a | b;
	int flag3 = (a & (!b) | ((!a) & b));
	int flag4 = !a && !b;
	cout << flag1 << " " << flag2 << " " << flag3 << " " << flag4;
	return 0;
}